package com.ruoyi.system.mapper.app;

import com.ruoyi.system.domain.app.Device;
import com.ruoyi.system.domain.app.DeviceSpace;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface DeviceSpaceMapper {
    int deleteByPrimaryKey(Long id);

    int delByDeviceId(Long deviceId);

    int insert(DeviceSpace record);

    int insertSelective(DeviceSpace record);

    DeviceSpace selectByPrimaryKey(Long id);

    DeviceSpace getByBindNo(String qcCode);

    List<Map> getSocketStateList(@Param("list")List<Device> deviceList);

    List<DeviceSpace> getByDeviceId(Long deviceId);

    int getIdleCount(Long deviceId);

    DeviceSpace selectBySpaceId(@Param("deviceId")Long deviceId,@Param("spaceId")Integer spaceId);

    int updateByPrimaryKeySelective(DeviceSpace record);

    int updateByPrimaryKey(DeviceSpace record);

    int updateState(@Param("deviceId")Long deviceId,@Param("list")List<Integer> integers);

    int updateStateVoltage(@Param("deviceId")Long deviceId,@Param("list")List<Integer> floats);

    int updateStateCurrent(@Param("deviceId")Long deviceId,@Param("list")List<Float> floats);

    int updateStatePower(@Param("deviceId")Long deviceId,@Param("list")List<Float> floats);

    int  updateStateType(@Param("deviceId")Long deviceId,@Param("index") Integer index,@Param("state")Integer state);
}